package dev.alm.javaai.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
@AllArgsConstructor
@NoArgsConstructor
// @Document指定集合名称
@Document("chat_messages")
public class ChatMessages {

    // @Id：唯一标识，映射到MongoDB中文档的_id字段（主键）
    // 使用bson类型ObjectId
    @Id
    private ObjectId messageId;

    private String memoryId;

    private String content; // json字符串

    public ChatMessages(String content) {
        this.content = content;
    }

}
